package io.xiyou.xmq.core;

public final class Xmq {

    public Xmq(String topic, int capacity) {
        this.topic = topic;
        this.capacity = capacity;
        this.queue = new MyLinkedQueue(capacity);
    }

    private String topic;

    private int capacity;

    private MyLinkedQueue<XmqMessage> queue;

    public boolean send(XmqMessage message) {
        return queue.offer(message);
    }

    public XmqMessage poll() {
        return queue.poll();
    }

//    @SneakyThrows
//    public KmqMessage poll(long timeout) {
//        return queue.poll(timeout, TimeUnit.MILLISECONDS);
//    }

}
